
const { ccclass, property, menu } = cc._decorator;

@ccclass
@menu('classic/OptionItemComponent')
export default class OptionItemComponent extends cc.Component {


    @property(cc.Label)
    contentLbl: cc.Label = null;

    initUI(content: string) {
        this.contentLbl.string = this.cap(content);
    }

    onResult(right: boolean) {
    }

    private cap(sentence: string) {
        const words = sentence.split(' ');
        for (let i = 0; i < words.length; i++) {
            words[i] = words[i][0].toUpperCase() + words[i].substr(1);
        }
        return words.join(' ');
    }
}
